home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Developer Toolbox 6.1
/
SGI Developer Toolbox 6.1 - Disc 4.iso
/
src
/
swtools
/
trubasic
/
rolldemos
/
chooser
/
util.tru
< prev
Wrap
Text File
|
1994-08-02
|
2KB
|
81 lines
external
! utilities for menu screens
!--------------------------------------------------------------------
sub expand(x1,x2,y1,y2)
set color "blue"
box area x1,x2,y1,y2
end sub
sub unexpand(x1,x2,y1,y2)
set color "black"
box area x1,x2,y1,y2
set color 25
box lines x1,x2,y1,y2
end sub
picture box(x1,x2,y1,y2,op)
! foreground color
set color mix (25) 25/255,0,172/255
set color 25
let sinc=.05
! triangle for left and top shadow
plot area: x1-sinc,y1-sinc;x2+sinc,y2+sinc;x1-sinc,y2+sinc
! line from bottom left to top right
plot x1-sinc,y1-sinc;x1-sinc,y2+sinc
! right side line
plot x2+sinc,y2+sinc;x2+sinc,y1-sinc
! bottom line
plot x1-sinc,y1-sinc;x2+sinc,y1-sinc
! lower right diagonal line
plot x2,y1;x2+sinc,y1-sinc
set color "black"
! button area
plot area: x1,y1;x1,y2;x2,y2;x2,y1
! upper left diagonal line
plot x1,y2;x1-sinc,y2+sinc
set color "blue"
! button area
!plot area: x1,y1;x1,y2;x2,y2;x2,y1
plot x1,y1;x1,y2;x2,y2;x2,y1;x1,y1
end picture
picture textbox(x1,x2,y1,y2,a$)
let x=(x2-x1) /2 + x1
set color "white"
let sp=cpos(a$," ")
if sp=0 then
let y=(y2-y1) /2 + y1
plot text, at x,y:a$
else
let y=8*(y2-y1) /12 + y1
plot text, at x,y:a$[1:sp]
let y=5*(y2-y1) /12 + y1
let n=len(a$)
plot text, at x,y:a$[sp+1:n]
end if
end picture
sub waitup
get mouse x,y,state
do while state<>0 or x>1 or x<0 or y>1 or y<0
get mouse x,y,state
loop
end sub
sub waitclick
get mouse x,y,state
do while state=0
get mouse x,y,state
loop
end sub